package com.xing.util;

import javax.servlet.http.HttpServletRequest;

/*
 * 静，谦虚谨慎，心胸宽广容纳所有好的坏的、先苦后甜
 * day41_transaction
 * 2021/5/9 17:00
 */
public class TokenUtils {
    //向session添加令牌
    public static void addToken(HttpServletRequest request,String tokenName){
        String token = TokenProcessor.createToken();
        request.getSession().setAttribute(tokenName,token);
    }
    //从session移除令牌
    public static void removeToken(HttpServletRequest request,String tokenName){
        request.getSession().removeAttribute(tokenName);
    }
}
